<template>
  <el-dialog :title="title" :visible.sync="dialogFormVisible" width="500px">
    <div class="tree">
      <el-form
        size="small"
        :inline="true"
        label-width="48px"
        v-if="this.open == 1"
      >
        <el-form-item>
          <el-input />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini"
            >搜索</el-button
          >
          <el-button icon="el-icon-refresh" size="mini">清除</el-button>
        </el-form-item>
      </el-form>
      <el-tree
        :data="data"
        show-checkbox
        node-key="id"
        :default-expanded-keys="[2, 3]"
        :default-checked-keys="[5]"
        :props="defaultProps"
      >
      </el-tree>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="dialogFormVisible = false">取 消</el-button>
      <el-button type="primary" @click="dialogFormVisible = false"
        >上 报</el-button
      >
    </div>
  </el-dialog>
</template>
<script>
export default {
  data() {
    return {
      open: 2,
      dialogFormVisible: false,
      title: "",
      data: [
        {
          id: 1,
          label: "一级 1",
          children: [
            {
              id: 4,
              label: "二级 1-1",
              children: [
                {
                  id: 9,
                  label: "三级 1-1-1",
                },
                {
                  id: 10,
                  label: "三级 1-1-2",
                },
              ],
            },
          ],
        },
        {
          id: 2,
          label: "一级 2",
          children: [
            {
              id: 5,
              label: "二级 2-1",
            },
            {
              id: 6,
              label: "二级 2-2",
            },
          ],
        },
        {
          id: 3,
          label: "一级 3",
          children: [
            {
              id: 7,
              label: "二级 3-1",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
          ],
        },
      ],
      defaultProps: {
        children: "children",
        label: "label",
      },
    };
  },
  methods: {
    neworganization() {
      this.title = "上报培训计划";
      this.dialogFormVisible = true;
      this.open = 1;
    },
    //报告管理 上报
    newappear() {
      this.dialogFormVisible = true;
      this.title = "上报培训报告";
      this.open = 1;
    },
    NewReported() {
      this.dialogFormVisible = true;
      this.title = "上报总结报告";
    },
  },
};
</script>

<style>
</style>